<?php

namespace Modules\Payment\Entities;

use Modules\Core\Entities\BaseEntity as Model;

class PaymentRecord extends Model
{
    protected $guarded = [];
    protected $table = 'payment_records';
    protected $casts = [
        'options' => 'array',
    ];

    static public $resourceName = '支付记录';

    // public function order()
    // {
    // 	return $this->belongsTo('\Core\Order\Entities\Order', 'order_id');
    // }

    // public function unionOrder()
    // {
    // 	return $this->belongsTo('\Core\Order\Entities\UnionOrder', 'union_order_id');
    // }

    // public function isWechatPay()
    // {
    // 	return $this->method === 1;
    // }

    // public function isMiniappPay()
    // {
    // 	return $this->isWechatPay();
    // }

    // public function prepayId()
    // {
    // 	if ($this->order)
    // 		return $this->order->prepay_id;
    // 	if ($this->unionOrder)
    // 		return $this->unionOrder->prepay_id;

    // 	return '';
    // }
}
